﻿/*                              
   Copyright 2011 Nils Kopal, Christopher Krüger, Simone Sauer, Dennis Nolte, Uni Duisburg-Essen

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
using System;

namespace Sharebert.OverlayLibrary.Messages
{
    /// <summary>
    /// A list of used message commands (types). Feel free to add new types here.
    /// </summary>
    public static class MessageTypes
    {

        public const string OFFLINE = "OFFLINE";

        public const string PING = "PING";

        /// <summary>
        /// Informs a client, that the peer is joining the ring.
        /// </summary>
        public const string JOIN = "JOIN";

        /// <summary>
        /// Informs a client, that the peer is joining as finger
        /// </summary>
        public const string FINGER_JOIN = "FINGER-JOIN";

        /// <summary>
        /// Requests the peer to close the connection, because another peer asks to become the new direct neighbour.
        /// </summary>
        public const string CLOSE_ON_JOIN_REQUEST = "REQUEST-CLOSE";

        /// <summary>
        /// Confirms the close request.
        /// </summary>
        public const string CLOSE_ON_JOIN_CONFIRM = "CONFIRM-CLOSE";

        /// <summary>
        /// Messge contains an overlay message.
        /// </summary>
        public const string OVERLAY_MESSAGE = "OVERLAY-MESSAGE";

        /// <summary>
        /// Bootstrap client uses this to request predecessor and successor.
        /// </summary>
        public const string NEIGHBOUR_REQUEST = "NEIGHBOUR-REQUEST";

        /// <summary>
        /// Bootstrap server uses this to respond with the predecessor and successor.
        /// </summary>
        public const string NEIGHBOUR_RESPONSE = "NEIGHBOUR-RESPONSE";

        /// <summary>
        /// Bootstrap server uses this to inform the client that his PeerID is already in use.
        /// </summary>
        public const string PEERID_IN_USE = "PEERID-IN-USE";

        /// <summary>
        /// A message from a peer searching for another peer to add him to his finger table
        /// </summary>
        public const string FINGER_SEARCH = "FINGER-SEARCH";
    }
}
